<template>
  <ul class='list'>
    <li v-for="item in getListData">
      <img :src="item.img" class="fl" alt="">
      <div>
        <p :class="'state '+ 'state'+item.state">{{item.state | formatState}}</p>
        <p class="title white-space">{{item.title}} <span class="color999" v-if="item.state">(已购买)</span></p>
        <p class="endtime">截止时间：{{item.endtime}}</p>
      </div>
    </li>
  </ul>
</template>
<script>
export default {
  props: ["listData"],
  components: {},
  name: "",
  data() {
    return {};
  },
  computed: {
    getListData() {
      return this.list = this.listData;
    }
  },
  filters:{
    formatState(val){
      var array=["未支付","使用中","已过期","待评价"]
      return array[val]
    }
  },
  methods: {},
  created() {}
};
</script>
<style lang="scss" scoped>
.list {
  background-color: #f2f2f2;
  padding-bottom: 0.1px;

  li{
    min-height: 90px;
    box-sizing: border-box;
    padding:15px 10px ;
    background-color: #fff;
    margin-bottom: 5px;

    >img{
      width: 80px;
      height: 60px;
    }
    >div{
      margin-left: 90px;
    }
    .state{
      width: 45px;
      height: 16px;
      line-height: 16px;
      font-size: 12px;
      text-align: center;
      border-top-right-radius: 8px;
      border-bottom-right-radius: 8px;
    }
    .state1,.state0{
      color: #fff;
      background-color: #F29622;
    }
    .state2{
      color: #999;
      background-color: #DDD;
    }
    .state3{
      color: #fff;
      background-color: #FF8B8B;
    }
    .title{
      color: #333;
      font-size: 14px;
      line-height: 30px;
    }
    .endtime{
      color: #999;
      font-size: 12px;
    }
  }
  
}
</style>